package com.fxp.project.jiuselu.web.business.v1.controller.carinfo;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fxp.project.jiuselu.web.base.controller.BaseController;
import com.fxp.project.jiuselu.web.domain.CommonResult;
import com.fxp.project.jiuselu.web.models.carinfo.entity.CarInfo;
import com.fxp.project.jiuselu.web.models.carinfo.service.ICarInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 车辆信息Controller
 *
 * @author Jason.Wang
 * @date 2022-05-06
 */
@RestController
@RequestMapping("/v1/car/info")
public class CarInfoController extends BaseController
{
    @Autowired
    private ICarInfoService carInfoService;

    /**
     * 查询车辆信息列表
     *
     */
    @PostMapping("/selectByOrderId")
    @CrossOrigin
    public CommonResult list(String orderId)
    {
        QueryWrapper<CarInfo> wrapper = new QueryWrapper<>();
        wrapper.eq("order_id",orderId);
        List<CarInfo> list = carInfoService.list(wrapper);
        return CommonResult.success(list);
    }


}
